package com.poi.demopoi.common.page;


import com.poi.demopoi.utils.StringUtils;

/**
 * 分页数据
 *
 * @author ruoyi
 */
public class PageDomain {
    /**
     * 当前记录起始索引
     */
    private Integer current;
    /**
     * 每页显示记录数
     */
    private Integer size;
    /**
     * 排序列
     */
    private String orders;
    /**
     * 排序的方向 "desc" 或者 "asc".
     */
    private String isAsc;

    public String getOrderBy() {
        if (StringUtils.isEmpty(orders)) {
            return "";
        }
        return StringUtils.toUnderScoreCase(orders) + " " + isAsc;
    }

    public Integer getCurrent() {
        return current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public String getOrders() {
        return orders;
    }

    public void setOrders(String orders) {
        this.orders = orders;
    }

    public String getIsAsc() {
        return isAsc;
    }

    public void setIsAsc(String isAsc) {
        this.isAsc = isAsc;
    }
}
